#!/usr/bin/env python
# coding=utf-8

filename = 'likeprogramming.txt'

with open(filename, 'a') as f_object:
    print("(输入'q'退出循环！)")
    while True:
        reason = input("你为什么喜欢编程：")
        if reason == 'q':
            break
        f_object.write(reason + '\n')

